import typescript from "@rollup/plugin-typescript"
import commonjs from "@rollup/plugin-commonjs"
import resolve from "@rollup/plugin-node-resolve"

module.exports = {
  input: "src/index.ts",
  output: {
    dir: "lib",
    format: "cjs",
    exports: "named",
    sourcemap: true,
  },
  external: ["axios", "qs", "tslib", "lodash", "decimal.js"],
  plugins: [
    resolve(),
    typescript({
      rootDir: "src",
      outDir: "lib",
      tsconfig: "tsconfig.json",
    }),
    commonjs({ extensions: [".js", ".ts"] }),
  ],
  watch: {
    include: "src/**",
    exclude: "node_modules/**",
  },
}
